package com.team.mp.api.controller;
import com.team.mp.api.bo.TeamAddBo;
import com.team.mp.api.bo.TeamPageBo;
import com.team.mp.api.bo.TeamUpdateBo;
import com.team.mp.api.service.intf.TeamService;
import com.team.mp.vo.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import org.springframework.web.bind.annotation.*;

/**
 * 千锋郑州Java学科欢迎你
 * @program: Tproject
 * @description: 控制层实现常用的外部接口
 * @author: xiaopi
 * @create: 2023-03-27 11:47:49
 */
@RestController
@RequestMapping("/api/team/")
@Api(tags = "实现Team的各种操作接口")
public class TeamController{
    /**
    * 注入业务逻辑层对象*/
    @Resource
    private TeamService service;
    /**
    * 新增内容*/
    @ApiOperation(value = "实现新增")
    @PostMapping("save.do")
    public R save(@RequestBody TeamAddBo bo){
       return service.save(bo);
    }
    /**
    * 修改内容*/
    @ApiOperation(value = "实现修改")
    @PostMapping("update.do")
    public R update(@RequestBody TeamUpdateBo bo){
        return service.update(bo);
    }
    /**
    * 查询 所有数据*/
    @ApiOperation(value = "实现全部查询")
    @GetMapping("all.do")
    public R all(){
       return service.queryAll();
    }
    /**
    * 查询 所有数据*/
    @ApiOperation(value = "实现查询单个")
    @GetMapping("single.do")
    public R single(long id){
        return service.queryById(id);
    }
    /**
    * 删除 单个数据*/
    @ApiOperation(value = "实现删除")
    @DeleteMapping("del.do")
    public R del(long id){
        return service.del(id);
    }

    @ApiOperation(value = "实现查询info")
    @GetMapping("info.do")
    public R getTeam(TeamPageBo bo){
        return service.getTeam(bo);
    }
}
